﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RadioThermostat
{
    public class RTTstatDatalog
    {
        public Dictionary<string,Dictionary<string,int>> Today { get; set; }
        public Dictionary<string, Dictionary<string, int>> Yesterday { get; set; }


        public int HeatTodayMinutes
        {
            get
            {
                return Today["heat_runtime"]["hour"] * 60 
                    + Today["heat_runtime"]["minute"];
            }
        }

        public int CoolTodayMinutes
        {
            get
            {
                return Today["cool_runtime"]["hour"] * 60 
                    + Today["cool_runtime"]["minute"];
            }
        }

        public int HeatYesterdayMinutes
        {
            get
            {
                return Yesterday["heat_runtime"]["hour"] * 60 
                    + Yesterday["heat_runtime"]["minute"];
            }
        }

        public int CoolYesterdayMinutes
        {
            get
            {
                return Yesterday["cool_runtime"]["hour"] * 60 
                    + Yesterday["cool_runtime"]["minute"];
            }
        }

        public override string ToString()
        {
            return "Heat Minutes today<" + this.HeatTodayMinutes + ">" + "Heat minutes yesterday<" + 
                this.HeatYesterdayMinutes + ">";
        }
    }
}
